package com.wyh.config;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Configuration//表明这是一个配置类
@ConfigurationProperties(prefix = "formula",ignoreInvalidFields = false)//该注解用于绑定属性。prefix用来选择属性的前缀，也就是在remote.properties文件中的“remote”，ignoreUnknownFields是用来告诉SpringBoot在有属性不能匹配到声明的域时抛出异常。
@PropertySource(value= "classpath:/com.wyh.formula/formula.properties",ignoreResourceNotFound = false)//配置文件路径
@Data
@Component
public class FormulaConfig {
    private String threeMeterBaseFormula;
    private String threeMeterBaseFormula_01;
    private String threeMeterBaseFormula_02;
    private String threeMeterBaseFormula_03;
    private String threeMeterBaseFormula_04;
    private String threeMeterBaseFormula_05;
    private String threeMeterBaseFormula_06;
    private String threeMeterBaseFormula_07;
    private String threeMeterBaseFormula_08;
    private String threeMeterBaseFormula_09;
    private String threeMeterBaseFormula_10;
    private String threeMeterBaseFormula_11;
    private String threeMeterBaseFormula_12;
    // 周期性计费公式
    private String periodicBillingFormula;
    private String periodicBillingFormula_01;
    private String periodicBillingFormula_02;
    private String periodicBillingFormula_03;
    private String periodicBillingFormula_04;
    private String periodicBillingFormula_05;
    private String periodicBillingFormula_06;
    private String periodicBillingFormula_07;
    private String periodicBillingFormula_08;
    private String periodicBillingFormula_09;
    private String periodicBillingFormula_10;
    private String periodicBillingFormula_11;
    private String periodicBillingFormula_12;
    private String periodicBillingFormula_13;

    // 临时计费公式
    private String temporaryBillingFormula;

    // 保证金计费公式
    private String depositBillingFormula;

    // 预存金计费公式
    private String preDepositBillingFormula;
    // 方法来获取所有计费公式的Map
    public Map<String, String> getAllBillingFormulas() {
        Map<String, String> billingFormulas = new HashMap<>();
        billingFormulas.put("threeMeterBaseFormula", this.getThreeMeterBaseFormula());
        billingFormulas.put("threeMeterBaseFormula_01", this.getThreeMeterBaseFormula_01());
        billingFormulas.put("threeMeterBaseFormula_02", this.getThreeMeterBaseFormula_02());
        billingFormulas.put("threeMeterBaseFormula_03", this.getThreeMeterBaseFormula_03());
        billingFormulas.put("threeMeterBaseFormula_04", this.getThreeMeterBaseFormula_04());
        billingFormulas.put("threeMeterBaseFormula_05", this.getThreeMeterBaseFormula_05());
        billingFormulas.put("threeMeterBaseFormula_06", this.getThreeMeterBaseFormula_06());
        billingFormulas.put("threeMeterBaseFormula_07", this.getThreeMeterBaseFormula_07());
        billingFormulas.put("threeMeterBaseFormula_08", this.getThreeMeterBaseFormula_08());
        billingFormulas.put("threeMeterBaseFormula_09", this.getThreeMeterBaseFormula_09());
        billingFormulas.put("threeMeterBaseFormula_10", this.getThreeMeterBaseFormula_10());
        billingFormulas.put("threeMeterBaseFormula_11", this.getThreeMeterBaseFormula_11());
        billingFormulas.put("threeMeterBaseFormula_12", this.getThreeMeterBaseFormula_12());
        // 添加周期性计费公式
        billingFormulas.put("periodicBillingFormula", periodicBillingFormula);
        billingFormulas.put("periodicBillingFormula_01", periodicBillingFormula_01);
        billingFormulas.put("periodicBillingFormula_02", periodicBillingFormula_02);
        billingFormulas.put("periodicBillingFormula_03", periodicBillingFormula_03);
        billingFormulas.put("periodicBillingFormula_04", periodicBillingFormula_04);
        billingFormulas.put("periodicBillingFormula_05", periodicBillingFormula_05);
        billingFormulas.put("periodicBillingFormula_06", periodicBillingFormula_06);
        billingFormulas.put("periodicBillingFormula_07", periodicBillingFormula_07);
        billingFormulas.put("periodicBillingFormula_08", periodicBillingFormula_08);
        billingFormulas.put("periodicBillingFormula_09", periodicBillingFormula_09);
        billingFormulas.put("periodicBillingFormula_10", periodicBillingFormula_10);
        billingFormulas.put("periodicBillingFormula_11", periodicBillingFormula_11);
        billingFormulas.put("periodicBillingFormula_12", periodicBillingFormula_12);
        billingFormulas.put("periodicBillingFormula_13", periodicBillingFormula_13);

        // 添加临时计费公式
        billingFormulas.put("temporaryBillingFormula", temporaryBillingFormula);

        // 添加保证金计费公式
        billingFormulas.put("depositBillingFormula", depositBillingFormula);

        // 添加预存金计费公式
        billingFormulas.put("preDepositBillingFormula", preDepositBillingFormula);

        return billingFormulas;
    }


}
